package com.itheima;

//学生类
class Student extends Person{
    //成绩
    private double score;
    //无参构造
    public Student() {
    }
    //全参构造
    public Student(String sid, String name, String age, String birthday, double score) {
        super(sid, name, age, birthday);
        this.score = score;
    }
    public double getScore() {
        return score;
    }
    public void setScore(double score) {
        this.score = score;
    }
}
//老师类
//设计规范: 继承的设计尽量满足is a关系
class Teacher extends Person{
    public Teacher() {
    }
    public Teacher(String sid, String name, String age, String birthday) {
        super(sid, name, age, birthday);
    }
}
//人类
class Person {
    private String sid;     //学号
    private String name;    //姓名
    private String age;     //年龄
    private String birthday;    //出生日期
    public Person() {
    }
    public Person(String sid, String name, String age, String birthday) {
        this.sid = sid;
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }
    public String getSid() {
        return sid;
    }
    public void setSid(String sid) {
        this.sid = sid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAge() {
        return age;
    }
    public void setAge(String age) {
        this.age = age;
    }
    public String getBirthday() {
        return birthday;
    }
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
    public void show(){
        System.out.println(sid + "," + name+","+age+","+birthday);
    }
}
public class Test6 {
    public static void main(String[] args) {
        //1. 无参构建学生对象
        Student stu = new Student();
        stu.setSid("heima001");
        stu.setName("柳岩");
        stu.setAge("36");
        stu.setBirthday("1999-11-11");
        stu.show();
        //2. 带参构造创建对象
        Student stu1 = new Student("heima002","杨幂","35","1995-11-11",99.9);
        stu1.show();
    }
}

